package com.aifast.system.sys.entity;

import com.aifast.common.base.BaseEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * <p>
 * 权限
 * </p>
 *
 * @author fujian
 * @since 2022-01-07
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@TableName("sys_authorities")
public class SysAuthorities extends BaseEntity {

    private static final long serialVersionUID = 1L;

    private String name;

    private String authority;

    private String url;

    private Integer pid;

    private Integer type;

    private Integer sort;

    private String icon;

    @TableField(exist = false)
    private boolean open = true;

    public boolean isOpen() {
        return this.pid == 0 ? open : false;
    }

    public void setOpen(boolean open) {
        this.open = open;
    }
}
